import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Foo from '@/components/Foo'
import Bar from '@/components/Bar'
import Children from '@/components/foo_children'

Vue.use(Router)

export default new Router({
  routes: [{
    path: '/helloworld',
    name: 'HelloWorld',
    component: HelloWorld,
    redirect: to => {
      return {name: 'Foo'}
    }
  }, {
    path: '/foo',
    name: 'Foo',
    component: Foo,
    children: [
      {
        path: 'foo_children',
        component: Children
      }
    ]
  }, {
    path: '/bar',
    component: Bar,
    name: 'Bar'
  }]
})
